Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combination of all three remaining PRs for beta3 #23

Closed
wants to merge 31 commits into from

Conversation

dra27
Copy link
Owner

@dra27 dra27 commented Jun 9, 2024

No description provided.

dra27 and others added 30 commits June 8, 2024 10:07
Previously, --git-location was treated as a default answer for the Git
menu, so it would display an error if Git wasn't found, but then simply
exit and fallback to adding Git to the Cygwin installation. Fix this
and validate either --git-location argument or the git-location opamrc
field as referring to a directory which contains Git.
Rather than filtering git out of the package list, instead add it when
required.
Make the ~cygbin parameter to the various executable identification
functions optional. The parameter is renamed to search_in_first with a
slightly revised semantics - if cygcheck.exe is not found in the
directory, then PATH is still searched.

This has a key benefit early on in opam init, as it allows cygbin to be
set for an internal Cygwin installation which has not yet happened, but
still permits curl (et al) to be used from PATH (e.g. when running opam
init from an MSYS2 shell).

Where before ~cygbin implied that cygcheck _must_ be used from the
directory, the new parameter effectively prepends an additional
directory to PATH.
Previously, MSYS2 required os-distribution to be overridden in
global-variables. Now, as with Cygwin, it is inferred in the same way
from cygcheck.

In this commit, opam init still sets os-distribution, however, if it is
manually removed from the root config file, previously `opam var
os-distribution` would return `win32` but now returns `msys2`.

Additionally, sys_pkg_manager_cmd is handled in the same way for MSYS2
as for Cygwin, allowing MSYS2 to be automatically added in the same way
as Cygwin.
Single argument function with a non-base type.
Includes more checks and also returns the kind of installation which was
found.
…te setup-x86_64.exe.sha512

I think I must have had in mind originally caching the sha512.sum file
from Cygwin.com, but what's ended up is unnecessarily complicated.
Instead, if setup-x86_64.exe then we compute its sha512; download
sha512.sum from Cygwin (which we assume will be quick) and compare that
before continuing to download setup-x86_64.exe if it's changed.
The ability to copy setup-x86_64.exe is no longer needed - but restore
the previous functionality which only downloaded setup if it didn't
exist and use this when displaying a command to the user. In this mode,
we only download setup-x86_64.exe so that the command we give to the
user actually works.

If we're actually going to run setup-x86_64.exe, then we download the
latest version.
Factor out the computation of the expected bindir.
Refactored to use "Add Git to" / "Use Git from" for both
--cygwin-location and when tools were found in PATH.
It is needed for Cygwin installation, that doesn't handle paths with
space.
At init, detection and redirection are done, afterwards opam always load
redirected opam root.
Original root directory is stored in
`OpamStateConfig.!r.original_root_dir`.
Previously, if the redirection was left behind but the redirected root
had been deleted, opam proceeded without any indication at all (easy if
either C:\opamroot has been deleted or, as in current behaviour, when
aborted opam init doesn't clean the redirection)
The rm -rf C:\opamroot can't stay!
@dra27 dra27 force-pushed the opamroot-redirect branch 2 times, most recently from c2d6f0d to 839acdb Compare June 10, 2024 11:02
@dra27 dra27 closed this Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants